package com.qf.dao;

import com.qf.common.dto.AuthInfoDto;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository

public interface AuthDao {

/**
 * 作者信息查询
 */

    @Select("select ud.image_url authImage, ud.nickname authName, \n" +
            "COUNT(t_npraise.id) likeName, COUNT(t_news.id) moonNum, COUNT(t_relation.uid1) fansNum\n" +
            " FROM\n" +
            "t_userdetail ud INNER JOIN t_news ON ud.uid = t_news.aid \n" +
            "INNER JOIN t_npraise on t_news.id = t_npraise.nid \n" +
            "INNER JOIN  t_relation on ud.uid = t_relation.uid2\n" +
            "where ud.uid = #{aid} ")
    @ResultType(com.qf.common.dto.AuthInfoDto.class)
    List<AuthInfoDto> selectAuthInfo(String aid);
}
